var pear_request_str = `GET /pearaa HTTP/1.1\r\n`+
     `Host: localhost\r\n`+
     `Connection: keep-alive\r\n`+
     `Pragma: no-cache\r\n`+
     `Cache-Control: no-cache\r\n`+
     `Upgrade-Insecure-Requests: 1\r\n`+
     `User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/53.0.2785.143 Chrome/53.0.2785.143 Safari/537.3\r\n`+
     `Accept: */*`+
     //`Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\r\n`+
     `Accept-Encoding: gzip, deflate, sdch\r\n`+
     `Accept-Language: en-US,en;q=0.8\r\n`+
     `Range: bytes=0-5\r\n`+
     `\r\n`;

//  curl -r 0-9 192.168.31.117:8899/hello

var curl_test=`
request:
GET /hello HTTP/1.1
Host: 192.168.31.117:8899
Range: bytes=0-9
User-Agent: curl/7.47.0
Accept: */*

response:

HTTP/1.1 206 Partial Content
Server: nginx/1.6.0
Date: Tue, 06 Dec 2016 08:49:19 GMT
Content-Type: application/octet-stream
Content-Length: 10
Last-Modified: Tue, 06 Dec 2016 07:43:09 GMT
Connection: keep-alive
ETag: "58466c0d-13"
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, OPTIONS, HEAD, DELETE, PUT
Access-Control-Expose-Headers: X-PEAR-ARGS
Content-Range: bytes 0-9/19

1122334455
`

function pear_request()
{
  //console.log(pear_request_str);
  Janus.log("begin send message");
  textroom.data({
	text: pear_request_str,
	error: function(reason) { bootbox.alert(reason); },
	success: function() { $('#datasend').val(''); }
    });
}
function pear_response_handle(response)
{
   console.log("response type is : "+typeof response);
   var content=response.split(`\r\n\r\n`)[1]; 
   console.log("content is : " + content);

   //for(var i=0,j=response.length;i<j;++i){
   // console.log(response.charCodeAt(i));
   //}
}